package org.esk.dablog.dao;

import org.esk.dablog.model.Entry;
import org.esk.dablog.model.forum.ForumPostEntry;

import java.util.List;
import java.util.Date;

/**
 * This class provides Entry entity management
 * User: jc
 * Date: 22.11.2006
 * Time: 12:36:10
 * $Id:$
 */
public interface EntryDAO {

    /**
     * adds new entry
     * @param entry
     * @return
     */
    long addEntry(Entry entry);

    /**
     * returns list of entries
     * @return @param clazz
     */
    List<Entry> listEntries(Class<? extends Entry> clazz, int count);

    /**
     * returns list of Date objects, one for each existing entry
     * entries per single date
     * @param clazz
     *@param time
     * @param time1 @return
     */
    List<Date> listEntriesPerDate(Class<? extends Entry> clazz, Date time, Date time1);

    /**
     * returns list of entries by entry date
     * @param start
     *@param end @return
     */
    List listEntriesByDate(Class<? extends Entry> clazz, Date start, Date end);

    /**
     * returns entry by its id
     * @param entryId
     * @return
     */
    Entry getEntry(Class<? extends Entry> clazz, long entryId);

    /**
     * Updates Entry instance in database
     * @param entry
     */
    void updateEntry(Entry entry);

    /**
     * Lists entries of specified class
     * @param clazz
     * @return
     */
    List listEntries(Class<? extends Entry> clazz);

    /**
     * Lists entries of specified classes, paginated version
     * @param entryClasses
     * @param start
     * @param count
     * @return
     */
    List<Entry> listEntries(List<Class<? extends Entry>> entryClasses, int start, int count);

    /**
     * returns List of visible (state < 1000) entries
     * @param aClass
     * @param i
     * @return
     */
    List listVisibleEntries(Class<? extends Entry> clazz, int i);

    /**
     * deletes entry
     * @param entryId
     */
    void deleteEntry(long entryId);
}
